#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Action.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Association;
class InputPin;

/// <summary>
/// ClearAssociationAction
/// A ClearAssociationAction is an Action that destroys all links of an Association
/// in which a particular object participates.
/// </summary>
class UMLMODEL_EXPORT ClearAssociationAction : public Action {

public: // Constructors and destructors
    explicit ClearAssociationAction(const QString& umlType="uml::ClearAssociationAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// association getter
    /// The Association to be cleared.
    /// </summary>
    shared_ptr<Association> association() const;

    /// <summary>
    /// association setter
    /// The Association to be cleared.
    /// </summary>
    void setAssociation(shared_ptr<Association> value);

    /// <summary>
    /// object getter
    /// The InputPin that gives the object whose participation in the Association is to
    /// be cleared.
    /// </summary>
    shared_ptr<InputPin> object() const;

    /// <summary>
    /// object setter
    /// The InputPin that gives the object whose participation in the Association is to
    /// be cleared.
    /// </summary>
    void setObject(shared_ptr<InputPin> value);

private: // Fields
    /// <summary>
    /// association
    /// The Association to be cleared.
    /// </summary>
    shared_ptr<Association> association_;

    /// <summary>
    /// object
    /// The InputPin that gives the object whose participation in the Association is to
    /// be cleared.
    /// </summary>
    shared_ptr<InputPin> object_;

};

} // namespace uml
